<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>网友评价标签</title>
<style>
    .hui-hot-sreach{background:#FFFFFF; padding:12px;}
    .hui-hot-sreach-title{line-height:38px; font-size:15px; font-weight:700;}
    .hui-hot-sreach-keys{margin-top:8px;}
    .hui-hot-sreach-keys a{display:block; border-radius:5px; float:left; margin:0 8px 10px 0px; padding:6px 10px; line-height:20px; font-size:13px; background:red;color:#fff;}
    #list2 li{width:50%; float:left; 0px;}
    #list2 .hui-img-list-content{padding:5px; padding-bottom:10px;}
    #list2 h1{font-size:14px;}
    #hui-load-more {
        margin-bottom:50px;
    }
    .time{
        font-size: 12px;
        height: 16px;
        line-height: 16px;
        margin-top: -16px;
        color: yellow;
        padding-left: 5px;
        z-index: 999;
        font-weight: bold;
    }
    @keyframes ani {
        0% {
            transform: scale(0.9,0.9);
            opacity:1;
            background-color:#fff;  
            color:red;
        }
        25% {
            transform:scale(1,1);
            opacity:0.9;
            background-color:yellow; 
            color:red;
        }
        50% {
            transform:scale(0.9,0.9);
            opacity:1;
            background-color:#fff;  
            color:red;
        }
        75% {
            transform:scale(1,1);
            opacity:0.9;
            background-color:yellow; 
            color:red;
        }
        100% {
            transform:scale(0.9,0.9);
            opacity:1;
            background-color:#fff;  
            color:red;
        }   
    }
    .home{
        position: fixed;
        z-index: 20;
        bottom: 100px;
        background: rgba(1,9,9,0.5);
        border-top-left-radius:15px;
        border-bottom-left-radius:15px;
        padding:5px 10px;
        color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 14px;
        right: 0px;
        font-weight: bold;
    }
</style>
<link type="text/css" rel="stylesheet" href="https://static-js001.oss-accelerate.aliyuncs.com/js-libs/HUI-master/css/hui.css?versionId=CAEQBxiBgIDm_OjzwxciIDIyMDAxMmJjOWQ0MDRlYzdhMDcxYWY2YmExY2QwYTBi" />
</head>
<body>

<div class="hui-wrap">
    <div class="hui-hot-sreach">
        <div class="hui-hot-sreach-title">点击下方标签加载(数据由评价已购视频产生)</div>
        <div class="hui-hot-sreach-keys">
            @foreach($tags as $tag)
            <a href="javascript:tagSearch({{$tag['id']}});">{{$tag['name']}}</a>
            @endforeach
        </div>
    </div>
</div>
<div id="refreshContainer" class="hui-refresh">
    <div class="hui-refresh-icon"></div>
    <div class="hui-refresh-content">
        <div class="hui-wrap">
        <div class="hui-img-list" id="list2" style="padding:10px 5px;">
            <ul id='video_list'></ul>
        </div>
    </div> 
    </div>
</div>
 
<div id="hui-black-mask" style="display: none;">
    <div id="hui-black-mask-content" style="position:fixed;transform: rotate(0deg);left:0;top:unset;bottom:0px;background:red;padding:5px 1%;padding-bottom:15px;border-top-right-radius: 10px;border-top-left-radius: 10px;">
        <div id="title" style="height: 45px;line-height:22.5px;color: #fff;width: 98vw;">
            付费观看
        </div>
        @if(config('visit.preview_video'))
            <div style="height: 30px;font-size: 20px;text-align: center;color:yellow;font-weight:bold;" id="view-tips">↓↓8秒试看↓↓</div>
        @else
            <div style="height: 18px;font-size: 14px;background:rgba(0,0,0,0.5);color:#fff;" id="view-tips"></div>
        @endif
        <div style="text-align:center;width:100%;position:relative">
            <div style="text-align:center;width:100%;position:relative;max-height: 70vh;padding-bottom: 0;">
                @if(config('visit.preview_video'))
                    <div id='preview'>
                        <div class='video-prew' style="height:200px;"></div>
                    </div>
                @else
                    <image class='now-pic' src="" style="max-height:70vh;width:100%;" />
                @endif
            </div>
            <a class='todetail' href='' style="text-align:center; color:#FFFFFF; line-height:60px; margin-left: 30px;" >
                <button id='btn-pay' style="filter:drop-shadow(0px 0px 0.5em yellow);margin:10px 0px;padding:8px 30px;background:gold;color:red;font-size:20px;font-weight:bold;border:none;border-radius:30px;animation-name: ani;animation-duration:2s;animation-iteration-count: infinite;">
                    付款 ￥{{$price}} 看整片
                </button>
            </a>
            <div id="hui-black-close" style='margin-top:10px;float:right;margin-right:10px;'  onclick='parse_video()'></div>
        </div>
    </div>
</div>
<a href="/born?code={{$code}}" class="home">🏠 回首页</a>
<script src="https://static-js001.oss-accelerate.aliyuncs.com/js/common/jquery.js?versionId=CAEQBxiBgMDz1erzwxciIGM4MzZhOGY1MWE0MDQ1OTliMDdkNDQzYTdhNjkxYzUz"></script>
<script src="https://static-js001.oss-accelerate.aliyuncs.com/js-libs/HUI-master/js/hui.js?versionId=CAEQBxiBgMCdzejzwxciIDc5YTI5YjlkZjBmZjRjZDk5NGQzMTI3MDRhOGZmOTI4"></script>
<script src="https://static-js001.oss-cn-guangzhou.aliyuncs.com/js-libs/HUI-master/js/hui-refresh-load-more.js?versionId=CAEQDBiBgMDstbeSyxciIDU1MDFiMmEzNGVmNjQxNTE5YzAzZmE1ZjIzZTlhYWI3"></script>
@if(config('visit.preview_video'))
<script src="/libs/ckplayer/ckplayer.min.js" data-name="ckplayer"></script>
@endif
<script>
    var videodomain ="{{$video_domain}}";
    var previewvideo = "{{config('visit.preview_video')}}";
    if(previewvideo && videodomain){
        var prewVideoObject = {
            container: '.video-prew',
            variable: 'player',
            video: "http://1.com",
            // mobileAutoFull: false,
            poster: './images/mobile/pre_face.jpg',
        };
        var videoPreplayer = new ckplayer(prewVideoObject);
    }
    function parse_video(){
        if(previewvideo && "undefined" != typeof videoPreplayer){
            videoPreplayer.videoPause()
        }
    }
</script>
<script src="/js/mobile/common.mix.js?001"   id='commonJs' price="{{$price}}"></script>
<script>
var tag_id = 1
var page = 1
var limit = 16
//加载推荐视频
function tagSearch(id){
    tag_id = id
    page = 1
    hui.ajax({
        type : 'POST',
        url : '/api/videos',
        data : {
            code:"{{$code}}",
            page:1,
            random_view:1,
            tag_id:tag_id,
            pic_type:"{{$pic_type}}",
        },
        timeout:10000,
        backType:'JSON',
        beforeSend : function(){ 
            hui.loading('加载中...');
        },
        complete   : function(){
            hui.closeLoading();
        },
        success : function(res){
            if(res['status'] == 'success'){
                document.getElementById('video_list').innerHTML = ""
                appendData(res['data']['videos'],"{{$pic_type}}","{{$code}}",res['data']['img_cdns']||[],res['data']['img_domain']||'');
                page =2;
                if(res['data']['videos'].length <= limit || 16){
                    hui.endLoadMore(true,'等待更多网友评价...');
                    return false;
                }
                hui.resetLoadMore();
            }else{
                hui.iconToast('加载失败，请重试', 'warn')
            }
        },
        error : function(e){
            hui.upToast('网络异常，请重试！');
        }
    })
}

function getMore(){
    $.ajax({
        type : 'POST',
        url : '/api/videos',
        data : {
            code:"{{$code}}",
            page:page,
            distinct:1,
            tag_id:tag_id,
            random_view:1,
            pic_type:"{{$pic_type}}",
        },
        timeout:30000,
        backType:'JSON',
        beforeSend : function(){ },
        complete   : function(){},
        success : function(res){
            if(res['status'] == 'success'){
                appendData(res['data']['videos'],"{{$pic_type}}","{{$code}}",res['data']['img_cdns']||[],res['data']['img_domain']||'');
                page ++;
                if(res['data']['videos'].length <=0){
                    hui.endLoadMore(true,'等待更多网友评价...');
                    return false;
                }
                hui.endLoadMore();
            }else{
                hui.endLoadMore();
                hui.iconToast('请求错误，请重试', 'warn');
            }
        },
        error: function (jqXHR, textStatus, errorThrown) {
            hui.endLoadMore();
            hui.upToast('网络异常，请重试！');
        }
    })
}
tagSearch(1)
hui.loadMore(getMore);
</script>
</body>
</html>